package com.rico.deploy.service.impl;

import com.github.pagehelper.PageHelper;
import com.rico.deploy.entity.College;
import com.rico.deploy.entity.Schoolyear;
import com.rico.deploy.entity.Week;
import com.rico.deploy.mapper.SchoolyearMapper;
import com.rico.deploy.service.SchoolyearService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 夏智力
 * @FileName SchoolyearServiceImpl
 * @date 2021/5/2 16:02
 * @Software: IntelliJ IDEA
 */
@Service
public class SchoolyearServiceImpl implements SchoolyearService {

    @Autowired
    SchoolyearMapper schoolyearMapper;

    @Override
    public List<Schoolyear> selectAll() {
        return schoolyearMapper.selectAll();
    }

    @Override
    public List<Schoolyear> selectAll(Integer page, Integer limit) {
        PageHelper.startPage(page,limit);
        return schoolyearMapper.selectAll();
    }

    @Override
    public Schoolyear selectById(Integer id) {
        return schoolyearMapper.selectByPrimaryKey(id);
    }

    @Override
    public int insertSchoolyear(Schoolyear schoolyear) {
        return schoolyearMapper.insert(schoolyear);
    }

    @Override
    public int deleteSchoolyearById(Integer id) {
        return schoolyearMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int updateSchoolyear(Schoolyear schoolyear) {
        return schoolyearMapper.updateByPrimaryKey(schoolyear);
    }
}
